package com.yushu.authority.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yushu.authority.pojo.bo.PmUser;
import com.yushu.authority.pojo.vo.MenuOnRoleVO;
import com.yushu.authority.pojo.vo.PmMenuTreeVO;
import com.yushu.common.util.pager.Pages;
import org.apache.ibatis.annotations.Param;

import java.util.Map;
import java.util.List;


import com.yushu.authority.pojo.vo.PmMenuVO;
import com.yushu.authority.pojo.bo.PmMenu;



 /**
 * 
 * @author test
 * @CreateDate 2020-12-03 15:47:24
 */
public interface PmMenuMapper extends BaseMapper<PmMenu> {
    List<PmMenuVO> selectPageList(Pages page, @Param("ew") EntityWrapper<PmMenuVO> wrapper);

    int queryCountByName(@Param("map") Map map);

    /**
     * TODO mybatis递归查询
     *
     * @return
     */
    List<PmMenuTreeVO> queryMenuTree(@Param("user") PmUser user);

     //通过菜单id查询是否绑定角色
     int selectRoleByMenuId(@Param("mid") String id);

    void deleteBatchByURls(@Param("list") List<String> urlList);

    void deleteMenuOnRoleByUrls(@Param("list") List<String> urlList);

    int selectMaxSortId();


    void deleteMenuOnMenu(@Param("menu") PmMenu menu);

    void deleteMenuOnRole(@Param("list") List<MenuOnRoleVO> onRoleVOS);

    void insertMenuOnRole(@Param("list") List<MenuOnRoleVO> onRoleVOS);
    
    //查询父菜单有无子菜单

     int queryFatherMenuName(String pid);

}
